1 /*
2 
3 Boost Software License - Version 1.0 - August 17th, 2003
4 
5 Permission is hereby granted, free of charge, to any person or organization
6 obtaining a copy of the software and accompanying documentation covered by
7 this license (the "Software") to use, reproduce, display, distribute,
8 execute, and transmit the Software, and to prepare derivative works of the
9 Software, and to permit third-parties to whom the Software is furnished to
10 do so, all subject to the following:
11 
12 The copyright notices in the Software and this entire statement, including
13 the above license grant, this restriction and the following disclaimer,
14 must be included in all copies of the Software, in whole or in part, and
15 all derivative works of the Software, unless such copies or derivative
16 works are solely in the form of machine-executable object code generated by
17 a source language processor.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
22 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
23 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
24 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 DEALINGS IN THE SOFTWARE.
26 
27 */ 
28 
29 module derelict.purple.sound;
30 
31 import derelict.glib.gtypes;
32 import derelict.glib.glibconfig;
33 import derelict.purple.account;
34 
35 extern (C):
36 
37 alias _PurpleSoundEventID PurpleSoundEventID;
38 alias _PurpleSoundUiOps PurpleSoundUiOps;
39 
40 enum _PurpleSoundEventID
41 {
42 	PURPLE_SOUND_BUDDY_ARRIVE = 0,
43 	PURPLE_SOUND_BUDDY_LEAVE = 1,
44 	PURPLE_SOUND_RECEIVE = 2,
45 	PURPLE_SOUND_FIRST_RECEIVE = 3,
46 	PURPLE_SOUND_SEND = 4,
47 	PURPLE_SOUND_CHAT_JOIN = 5,
48 	PURPLE_SOUND_CHAT_LEAVE = 6,
49 	PURPLE_SOUND_CHAT_YOU_SAY = 7,
50 	PURPLE_SOUND_CHAT_SAY = 8,
51 	PURPLE_SOUND_POUNCE_DEFAULT = 9,
52 	PURPLE_SOUND_CHAT_NICK = 10,
53 	PURPLE_SOUND_GOT_ATTENTION = 11,
54 	PURPLE_NUM_SOUNDS = 12
55 }
56 
57 struct _PurpleSoundUiOps
58 {
59 	void function () init;
60 	void function () uninit;
61 	void function (const(char)*) play_file;
62 	void function (PurpleSoundEventID) play_event;
63 	void function () _purple_reserved1;
64 	void function () _purple_reserved2;
65 	void function () _purple_reserved3;
66 	void function () _purple_reserved4;
67 }
68 
69 version(Derelict_Link_Static)
70 {
71     extern( C ) nothrow 
72     {
73         void purple_sound_play_file(const(char)* filename, const(PurpleAccount)* account);
74         void purple_sound_play_event(PurpleSoundEventID event, const(PurpleAccount)* account);
75         void purple_sound_set_ui_ops(PurpleSoundUiOps* ops);
76         PurpleSoundUiOps* purple_sound_get_ui_ops();
77         void purple_sound_init();
78         void purple_sound_uninit();
79         void* purple_sounds_get_handle();
80     }
81 }
82 else
83 {
84     extern( C ) nothrow 
85     {
86         alias da_purple_sound_play_file = void function(const(char)* filename, const(PurpleAccount)* account);				
87         alias da_purple_sound_play_event = void function(PurpleSoundEventID event, const(PurpleAccount)* account);			
88         alias da_purple_sound_set_ui_ops = void function(PurpleSoundUiOps* ops);											
89         alias da_purple_sound_get_ui_ops = PurpleSoundUiOps* function();													
90         alias da_purple_sound_init = void function();																		
91         alias da_purple_sound_uninit = void function();																		
92         alias da_purple_sounds_get_handle = void* function();		
93     }
94 
95     __gshared
96     {
97 	    da_purple_sound_play_file purple_sound_play_file;
98 	    da_purple_sound_play_event purple_sound_play_event;
99 	    da_purple_sound_set_ui_ops purple_sound_set_ui_ops;
100 	    da_purple_sound_get_ui_ops purple_sound_get_ui_ops;
101 	    da_purple_sound_init purple_sound_init;
102 	    da_purple_sound_uninit purple_sound_uninit;
103 	    da_purple_sounds_get_handle purple_sounds_get_handle;
104     }
105 }